# 集合的操作

s1 = set([1, 2, 3, 4, 5])
print(s1)

for i in s1:
    print(i)

for index, data in enumerate(s1):
    print(index, data)

# list 是可变的，所以不可以添加
# s1.add([1, 2, 3])
s1.add("3")
s1.add((1, 22, 33, 4))
print(s1)

s2 = {1, 2, 3, 4, 5}
# 转成list
list1 = list(s2)
print(list1)

# 转成元组
tuple1 = tuple(s2)
print(tuple1)

# list转成set 去重
list2 = [1, 2, 3, 4, 5, 6, 3, 4]
set1 = set(list2)
print(set1)




